import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home/index'
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    children: [
      {
        path: 'index',
        component: () => import('../views/Index.vue')
      },
      {
        path: 'jgc-list',
        component: () => import('../views/me/JgcList.vue')
      },
      {
        path: 'jgc-add',
        component: () => import('../views/me/JgcAdd.vue')
      },
      {
        path: 'fzjg-list',
        component: () => import('../views/me/FzjgList.vue')
      },
      {
        path: 'fzjg-add',
        component: () => import('../views/me/FzjgAdd.vue')
      },
      {
        path: 'lishi-add',
        component: () => import('../views/pinpai/LishiAdd.vue')
      },
      {
        path: 'lishi-list',
        component: () => import('../views/pinpai/LishiList.vue')
      },
      {
        path: 'rongyu-add',
        component: () => import('../views/pinpai/RongyuAdd.vue')
      },
      {
        path: 'rongyu-list',
        component: () => import('../views/pinpai/RongyuList.vue')
      },
      {
        path: 'product-add',
        component: () => import('../views/product/ProductAdd.vue')
      },
      {
        path: 'product-list',
        component: () => import('../views/product/ProductList.vue')
      },

    ]
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
